<template>
  <div id="notinwave" v-loading="loading">
    <v-tableTitle
      :btnConfig="btnConfig"
      :tableSelectData="tableSelectData"
      :title="$t('wave.notinwave')"
    ></v-tableTitle>
    <v-table
      :hasEdit="false"
      :page="page"
      :pageSize="pageSize"
      :tableConfig="tableConfig"
      :tableData="tableData"
      :total="total"
      @findData="getTableData"
      @getTableData="getTableData"
      @searhData="searhData"
      @selectData="selectData"
      @upData="getTableData"
      ref="table"
    ></v-table>
  </div>
</template>

<script type="text/ecmascript-6">
import tableTitle from "commons/TableTitle";
import table from "commons/Table";
import baseMixin from "@/mixins/BaseMixin";

export default {
    name: "notinwave",
    mixins: [baseMixin],
    data() {
        return {
            loading: false,
            tableConfig: [
              {
                  label: this.$t('out.orderkey'),
                  prop: "orderkey",
                  input: "input",
              },
              {
                  label: this.$t('config.shipper'),
                  prop: "storerkey",
                  input: "input"
              },
              {
                  label: this.$t('out.externorderkey',{no:1}),
                  prop: "externorderkey",
                  input: "input",
              },
              {
                  label: this.$t('common.type'),
                  prop: "type",
                  input: "select",
                  options: this.getOptions("querycodeLkup/ORDERTYPE")
              },
              {
                label: this.$t('wave.rtxsalesp'),
                prop: "rtxsalesp",
                input: "input",
              },
              {
                  label: this.$t('out.c_company'),
                  prop: "c_company",
                  input: "input",
              },
              {
                  label: this.$t('in.carriername'),
                  prop: "carriername",
                  input: "input",
              },
              {
                  label: this.$t('in.priority'),
                  prop: "priority",
                  input: "select",
                  options: this.getOptions("querycodeLkup/ORDRPRIOR")
              },
              {
                  label: this.$t('common.status'),
                  prop: "status",
                  input: "select",
                  options: this.getOptions("queryOrderStatusDropDown")
              },
              {
                  label: this.$t('in.podate1'),
                  prop: "orderdate",
                  input: "date",
              },
              {
                  label: this.$t('out.requestedshipdate'),
                  prop: "requestedshipdate",
                  input: "date",
              },
              {
                  label: this.$t('config.deliveryAddress'),
                  prop: "consigneekey",
                  input: "input",
              },
              {
                label: this.$t('wave.totalorderlines'),
                prop: "totalorderlines",
                input: "input",
              },
              {
                label: this.$t('config.num'),
                prop: "totalqty",
                input: "input",
              },
              {
                  label: this.$t('bill.carrierCode'),
                  prop: "carriercode",
                  input: "input",
              },
              {
                  label: this.$t('out.stage'),
                  prop: "stage",
                  input: "input",
              },
              {
                  label: this.$t('in.door'),
                  prop: "door",
                  input: "input",
              },
              {
                  label: this.$t('out.route'),
                  prop: "route",
                  input: "input",
              },
              {
                  label: this.$t('out.stop'),
                  prop: "stop",
                  input: "input",
              },
            ],
            tableData: [],
          page: 1,
            pageSize: 10,
            total: 10,
            tableSelectData: [],
            tableSearhData: {},
        };
    },
    computed: {
        btnConfig() {
            return []
        }
    },
    created() {
    },
    methods: {
        //选中的内容
        selectData(data) {
            this.tableSelectData = data;
        },
        async getTableData(page, data) {
            try {
                this.loading = true;
                let res = await this.$api.post(`/queryOrdersListIsNotInWave/${page}`, data);
                
                    this.tableData = res.page.list;
                  this.page = res.page.curpage;
                    this.pageSize = res.page.pageSize;
                    this.total = res.page.total;
                
            } catch (e) {
                this.$message.error(error);
            } finally {
                this.loading = false;
            }
        },
        //搜索的值
        searhData(data, up) {
            if (!up) {
                this.tableSearhData = data;
            } else {
                this.tableSearhData = data;
                this.getTableData(1, this.tableSearhData);
            }
        },
    },
    mounted() {
        this.$store.commit("setSkip", {});
        this.$store.commit("setNewFlag", false);
        this.$store.commit("setRouteData", {});
        this.getTableData(1, {});

    },
    watch: {},
    components: {
        "v-tableTitle": tableTitle,
        "v-table": table,
    }
};
</script>

<style scoped>
#notinwave {
  width: 100%;
  height: 99%;
  padding-top: 6px;
}
</style>
